
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="css/tail.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />

</head>
<body style="border-radius: 8px;width: 680px" onload="f()">
<form id="addform">
    <div class="top table2_top">
        <div>

            <div class="top_out">
                <table class="table">
                    <tbody>

                        <tr>
                            <td>分组编号<span></span></td>
                            <td colspan = "8" style="text-align: left">
                                <input type="text" name="id" style="width: 586px">
                            </td>
                        </tr>
                        <tr>
                            <td>分组名称<span></span></td>
                            <td colspan = "8" style="text-align: left">
                                <input type="text" name="name" style="width: 586px">
                            </td>
                        </tr>
                        <tr>
                            <td>备注<span></span></td>
                            <td colspan = "8"  style="text-align: left"><textarea name="note"></textarea></td>
                        </tr>

                    </tbody>
                </table>
            </div>
        </div>

        <div class="notice_bot">
            <div class="l_left"><input type="checkbox" checked="checked"/>保存并关闭窗口</div>
            <div class="r_right but_p">
                <button class="but_save" type="button" onclick="save()">导入</button>
                <button class="but_close" onclick="cancel()">关闭</button>
            </div>
        </div>

    </div>
</form>
<script type="text/javascript" src="js/jquery-2.2.0.min.js"></script>
<script src="js/jquery-2.2.0.min.js"></script>
<script src="js/bstable/js/bootstrap.min.js"></script>
<script src="js/groupLight.js"></script>

<script>
    //取消操作
    function cancel() {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
        tableLoad();
    }
function save() {
   alert("数据包提交成功，等待导入");
    $.ajax({
        url:"addGroup",
        data:$("#addform").serialize(),
        dataType:"text",
        type:"get",
        success:function(data) {
            if(data="1"){
                alert("成功")
                cancel();
                window.location="groupLight.html";

            }else {
                alert("失败")
                cancel();
            }
        }
    })

}
</script>
</body>
</html>
